<template>
  <!-- 这个是组件标签 -->
  <ref-2 ref="ren"></ref-2>

  <h2>用ref比id来讲可以分开 两个不干扰</h2>
  <h2 ref="title2">上海</h2>
  <button @click="showTitle">测试(实例对象)</button>
</template>

<script setup lang="ts" name="App">
import ref2 from "./ref2.vue";
import { ref, defineExpose } from "vue";

let title2 = ref();
let ren = ref();
function showTitle() {
  console.log(ren.value);
}
</script>

<style scoped>
/* scoped是局部样式 */
</style>
